
import Vue from 'vue'
import App from './App'
import kdic from 'utils/statusCode.js'
import { API_URL, BASE_UR} from './common/public_url.js'  

Vue.prototype.$kdic= kdic
Vue.prototype.$API_URL = API_URL


import uView from "uview-ui"
Vue.use(uView)

// #ifdef H5
Vue.prototype.getOpenId = function(){
	let name, value, str = location.href, num = str.indexOf("?");
	str = str.substr(num + 1);
	let arr = str.split("&"),url_data={};
	for (let i = 0; i < arr.length; i++) {
		num = arr[i].indexOf("=");
		if (num > 0) {
			name = arr[i].substring(0, num);
			value = arr[i].substr(num + 1);
			url_data.name = value;
			if(name=='openid'){
				uni.setStorageSync('openid', url_data.name)
				console.log(url_data.name, 'openid有吗')
			}else if(name=='appid'){
				uni.setStorageSync('appid', url_data.name)
			}else{
				// console.log('参数', name, url_data.name)
			}
		}
	}
}
// #endif



App.mpType = 'app'

const app = new Vue({
	...App
})
app.$mount()


